return true;
},
- _onScrollEvent: function (actor, event) {
+ scroll: function(event) {
let direction = event.get_scroll_direction();
let delta;
}
this._value = Math.min(Math.max(0, this._value + delta), 1);
+
this._slider.queue_repaint();
this.emit('value-changed', this._value);
},
+ _onScrollEvent: function(actor, event) {
+ this.scroll(event);
+ },
+
_motionEvent: function(actor, event) {
let absX, absY;
[absX, absY] = event.get_coords();
this._onControlStateChanged();
},
- scroll: function(direction) {
- let currentVolume = this._output.volume;
-
- if (direction == Clutter.ScrollDirection.DOWN) {
- let prev_muted = this._output.is_muted;
- this._output.volume = Math.max(0, currentVolume - this._volumeMax * VOLUME_ADJUSTMENT_STEP);
- if (this._output.volume < 1) {
- this._output.volume = 0;
- if (!prev_muted)
- this._output.change_is_muted(true);
- }
- this._output.push_volume();
- }
- else if (direction == Clutter.ScrollDirection.UP) {
- this._output.volume = Math.min(this._volumeMax, currentVolume + this._volumeMax * VOLUME_ADJUSTMENT_STEP);
- this._output.change_is_muted(false);
- this._output.push_volume();
- }
-
- this._notifyVolumeChange();
+ scroll: function(event) {
+ this._outputSlider.scroll(event);
},
_onControlStateChanged: function() {
},
_onScrollEvent: function(actor, event) {
- this._volumeMenu.scroll(event.get_scroll_direction());
+ this._volumeMenu.scroll(event);
}
});